home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / Coordinate.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-30  |  1.4 KB  |  48 lines

  1. package symantec.itools.db.awt;
  2.  
  3. public class Coordinate {
  4.    public int row;
  5.    public int col;
  6.  
  7.    public Coordinate() {
  8.    }
  9.  
  10.    public Coordinate(Coordinate c) {
  11.       this(c.row, c.col);
  12.    }
  13.  
  14.    public Coordinate(int r, int c) {
  15.       this.row = r;
  16.       this.col = c;
  17.    }
  18.  
  19.    public boolean equals(Object o) {
  20.       if (!(o instanceof Coordinate)) {
  21.          return false;
  22.       } else {
  23.          Coordinate c = (Coordinate)o;
  24.          return this.row == c.row && this.col == c.col;
  25.       }
  26.    }
  27.  
  28.    public void setRow(int r) {
  29.       this.row = r;
  30.    }
  31.  
  32.    public void setCol(int c) {
  33.       this.col = c;
  34.    }
  35.  
  36.    public int row() {
  37.       return this.row;
  38.    }
  39.  
  40.    public int col() {
  41.       return this.col;
  42.    }
  43.  
  44.    public String toString() {
  45.       return "Coordinate: row=" + this.row + " col=" + this.col;
  46.    }
  47. }
  48.